package cn.ym.ymcc.fallback;

import cn.ym.ymcc.doc.CourseDoc;
import cn.ym.ymcc.feign.SearchServerFeign;
import cn.ym.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SearchServerFeignFallbackFactory  implements FallbackFactory<SearchServerFeign> {
    @Override
    public SearchServerFeign create(Throwable throwable) {
       return new SearchServerFeign() {
           @Override
           public JSONResult save(CourseDoc courseDoc) {
               return JSONResult.error("系统繁忙，请稍后再试！！！");
           }
       };
    }
}
